import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/admin/role/index',
    method: 'get',
    params: query
  })
}

export function getAllRole() {
  return request({
    url: '/admin/role/getAll',
    method: 'get'
  })
}

export function roleDisable(data) {
  return request({
    url: '/admin/role/disable',
    method: 'post',
    data
  })
}

export function roleEnable(data) {
  return request({
    url: '/admin/role/enable',
    method: 'post',
    data
  })
}

export function addRole(data) {
  return request({
    url: '/admin/role/add',
    method: 'post',
    data
  })
}

export function updateRole(data) {
  return request({
    url: '/admin/role/edit',
    method: 'post',
    data
  })
}

export function deleteRole(data) {
  return request({
    url: '/admin/role/del',
    method: 'post',
    data
  })
}
